# 
# file initcode.S
# date 23.05.01
# author xin
# brief 初始/init的初始进程，赋值了init文件路径和两个参数作为系统调用参数，执行exec系统调用
# version 0.1
# status Stable
# 

#include "syscall.h"

# exec(init, argv)
.globl start
start:
        la a0, init
        la a1, argv
        li a7, SYS_exec
        ecall

# for(;;) exit();
exit:
        li a7, SYS_exit
        ecall
        jal exit

# char init[] = "/init\0"
init:
    .string "/init\0"

# char *argv[] = {init, 0};
argv:
    .long init
    .long 0
